package com.hyjx.kjframe.ui;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;

import com.hyjx.kjframe.ui.AnnotateUtil;
import com.hyjx.kjframe.ui.I_BroadcastReg;
import com.hyjx.kjframe.ui.I_KJActivity;

/**
 * @author kymjs (https://github.com/kymjs)
 * @version 1.8
 * Created by zhengfuwang on 2015/5/11.
 */
public abstract class FrameActivity extends AppCompatActivity implements
        View.OnClickListener,I_KJActivity, I_BroadcastReg{

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setRootView(); // 必须放在annotate之前调用
        AnnotateUtil.initBindView(this);
        initWidget();
        registerBroadcast();
    }

    @Override
    public void setRootView() {}

    @Override
    public void initWidget() {}

    @Override
    public void widgetClick(View v) {}

    @Override
    public void onClick(View view) {
        widgetClick(view);
    }

    @Override
    public void registerBroadcast() {}

    @Override
    public void unRegisterBroadcast() {}

    @Override
    protected void onDestroy() {
        unRegisterBroadcast();
        super.onDestroy();
    }
}
